package com.androidx.p013lv.base.glide;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import androidx.fragment.app.Fragment;
import com.androidx.p013lv.base.BaseSdk;
import com.androidx.p013lv.base.C1010R;
import com.androidx.p013lv.base.utils.UiUtils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.BaseRequestOptions;
import com.bumptech.glide.request.RequestOptions;

/* renamed from: com.androidx.lv.base.glide.GlideUtils */
public class GlideUtils {
    public static void loadVideo(String str, ImageView imageView) {
        Glide.with(imageView.getContext()).load(str).into(imageView);
    }

    public static void loadPic(String str, ImageView imageView) {
        ((RequestBuilder) Glide.with(imageView.getContext()).load(str).placeholder(C1010R.C1012drawable.base_ic_default_cover)).into(imageView);
    }

    public static void loadPic(Fragment fragment, String str, ImageView imageView) {
        ((RequestBuilder) Glide.with(fragment).load(str).placeholder(C1010R.C1012drawable.base_ic_default_cover)).into(imageView);
    }

    public static void loadPicWh(Fragment fragment, String str, ImageView imageView, int i, int i2) {
        RequestManager with = Glide.with(fragment);
        ((RequestBuilder) with.load(str + "?m=2&w=" + i + "&h=" + i2).placeholder(C1010R.C1012drawable.base_ic_default_cover)).into(imageView);
    }

    public static void loadPicWh(String str, ImageView imageView, int i, int i2) {
        RequestManager with = Glide.with(imageView.getContext());
        ((RequestBuilder) with.load(str + "?m=2&w=" + i + "&h=" + i2).placeholder(C1010R.C1012drawable.base_ic_default_cover)).into(imageView);
    }

    public static void loadPicWh2(Fragment fragment, String str, ImageView imageView, int i) {
        RequestManager with = Glide.with(fragment);
        ((RequestBuilder) with.load(str + "?m=1&w=" + i).placeholder(C1010R.C1012drawable.base_ic_default_cover)).into(imageView);
    }

    public static void loadPicWh2(String str, ImageView imageView, int i) {
        RequestManager with = Glide.with(imageView.getContext());
        ((RequestBuilder) with.load(str + "?m=1&w=" + i).placeholder(C1010R.C1012drawable.base_ic_default_cover)).into(imageView);
    }

    public static void loadPicDefault(ImageView imageView) {
        Glide.with(imageView.getContext()).load(Integer.valueOf(C1010R.C1012drawable.base_ic_default_cover)).into(imageView);
    }

    public static void loadPicHead(String str, ImageView imageView) {
        ((RequestBuilder) ((RequestBuilder) ((RequestBuilder) Glide.with(imageView.getContext()).load(str).placeholder(C1010R.C1012drawable.base_ic_default)).error(C1010R.C1012drawable.base_ic_default)).fallback(C1010R.C1012drawable.base_ic_default)).into(imageView);
    }

    public static void loadPicHeadDefault(ImageView imageView) {
        Glide.with(imageView.getContext()).load(Integer.valueOf(C1010R.C1012drawable.base_ic_default)).into(imageView);
    }

    public static void loadPicHead(Fragment fragment, String str, ImageView imageView) {
        ((RequestBuilder) ((RequestBuilder) ((RequestBuilder) Glide.with(fragment).load(str).placeholder(C1010R.C1012drawable.base_ic_default)).error(C1010R.C1012drawable.base_ic_default)).fallback(C1010R.C1012drawable.base_ic_default)).into(imageView);
    }

    public static void loadCircleHeadWhite(String str, ImageView imageView) {
        ((RequestBuilder) ((RequestBuilder) ((RequestBuilder) Glide.with(imageView.getContext()).load(str).placeholder(C1010R.C1012drawable.base_ic_default_white)).error(C1010R.C1012drawable.base_ic_default_white)).fallback(C1010R.C1012drawable.base_ic_default_white)).apply((BaseRequestOptions<?>) RequestOptions.bitmapTransform(new CircleCrop())).into(imageView);
    }

    public static void loadCirclePicHead(String str, ImageView imageView) {
        ((RequestBuilder) ((RequestBuilder) ((RequestBuilder) Glide.with(imageView.getContext()).load(str).placeholder(C1010R.C1012drawable.base_ic_default)).error(C1010R.C1012drawable.base_ic_default)).fallback(C1010R.C1012drawable.base_ic_default)).apply((BaseRequestOptions<?>) RequestOptions.bitmapTransform(new CircleCrop())).into(imageView);
    }

    public static void loadCirclePicHead(Fragment fragment, String str, ImageView imageView) {
        ((RequestBuilder) ((RequestBuilder) ((RequestBuilder) Glide.with(fragment).load(str).placeholder(C1010R.C1012drawable.base_ic_default)).error(C1010R.C1012drawable.base_ic_default)).fallback(C1010R.C1012drawable.base_ic_default)).apply((BaseRequestOptions<?>) RequestOptions.bitmapTransform(new CircleCrop())).into(imageView);
    }

    public static void loadCirclePicHeadWh(Fragment fragment, String str, ImageView imageView, int i, int i2) {
        RequestManager with = Glide.with(fragment);
        ((RequestBuilder) ((RequestBuilder) ((RequestBuilder) with.load(str + "?m=2&w=" + i + "&h=" + i2).placeholder(C1010R.C1012drawable.base_ic_default)).error(C1010R.C1012drawable.base_ic_default)).fallback(C1010R.C1012drawable.base_ic_default)).apply((BaseRequestOptions<?>) RequestOptions.bitmapTransform(new CircleCrop())).into(imageView);
    }

    public static void loadCropRadiusWh(Fragment fragment, String str, int i, ImageView imageView, int i2, int i3) {
        if (fragment == null) {
            loadCropRadiusWh(str, i, imageView, i2, i3);
            return;
        }
        RequestManager with = Glide.with(fragment);
        ((RequestBuilder) ((RequestBuilder) with.load(str + "?m=2&w=" + i2 + "&h=" + i3).placeholder(C1010R.C1012drawable.base_ic_default_cover)).thumbnail(loadTransform(imageView.getContext(), C1010R.C1012drawable.base_ic_default_cover, (float) i)).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(i)))).into(imageView);
    }

    public static void loadCropRadiusWh2(Fragment fragment, String str, int i, ImageView imageView, int i2) {
        if (fragment == null) {
            loadCropRadiusWh2(str, i, imageView, i2);
            return;
        }
        RequestManager with = Glide.with(fragment);
        ((RequestBuilder) ((RequestBuilder) with.load(str + "?m=1&w=" + i2).placeholder(C1010R.C1012drawable.base_ic_default_cover)).thumbnail(loadTransform(imageView.getContext(), C1010R.C1012drawable.base_ic_default_cover, (float) i)).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(i)))).into(imageView);
    }

    public static void loadCropRadiusWh2(String str, int i, ImageView imageView, int i2) {
        RequestManager with = Glide.with(imageView.getContext());
        ((RequestBuilder) ((RequestBuilder) with.load(str + "?m=1&w=" + i2).placeholder(C1010R.C1012drawable.base_ic_default_cover)).thumbnail(loadTransform(imageView.getContext(), C1010R.C1012drawable.base_ic_default_cover, (float) i)).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(i)))).into(imageView);
    }

    public static void loadCropRadius(Fragment fragment, String str, int i, ImageView imageView) {
        if (fragment == null) {
            loadCropRadius(str, i, imageView);
            return;
        }
        ((RequestBuilder) ((RequestBuilder) Glide.with(fragment).load(str).placeholder(C1010R.C1012drawable.base_ic_default_cover)).thumbnail(loadTransform(imageView.getContext(), C1010R.C1012drawable.base_ic_default_cover, (float) i)).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(i)))).into(imageView);
    }

    private static RequestBuilder<Drawable> loadTransform(Context context, int i, float f) {
        return Glide.with(context).load(Integer.valueOf(i)).apply(((RequestOptions) new RequestOptions().centerCrop()).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(f))));
    }

    public static void loadCropRadiusWh(String str, int i, ImageView imageView, int i2, int i3) {
        RequestManager with = Glide.with(imageView.getContext());
        ((RequestBuilder) ((RequestBuilder) with.load(str + "?m=2&w=" + i2 + "&h=" + i3).placeholder(C1010R.C1012drawable.base_ic_default_cover)).thumbnail(loadTransform(imageView.getContext(), C1010R.C1012drawable.base_ic_default_cover, (float) i)).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(i)))).into(imageView);
    }

    public static void loadCropRadius(String str, int i, ImageView imageView) {
        ((RequestBuilder) ((RequestBuilder) Glide.with(imageView.getContext()).load(str).placeholder(C1010R.C1012drawable.base_ic_default_cover)).thumbnail(loadTransform(imageView.getContext(), C1010R.C1012drawable.base_ic_default_cover, (float) i)).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(i)))).into(imageView);
    }

    public static void loadCropRadiusDefault(int i, ImageView imageView) {
        ((RequestBuilder) Glide.with(imageView.getContext()).load(Integer.valueOf(C1010R.C1012drawable.base_ic_default_cover)).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(i)))).into(imageView);
    }

    public static void loadCropRadiusDefault(Fragment fragment, int i, ImageView imageView) {
        if (fragment == null) {
            loadCropRadiusDefault(i, imageView);
            return;
        }
        ((RequestBuilder) Glide.with(fragment).load(Integer.valueOf(C1010R.C1012drawable.base_ic_default_cover)).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(i)))).into(imageView);
    }

    public static void loadResId(int i, ImageView imageView) {
        Glide.with(imageView.getContext()).load(Integer.valueOf(i)).into(imageView);
    }

    public static void clear() {
        Glide.get(BaseSdk.getContext()).clearMemory();
    }

    public static void loadPicHeadWh(String str, ImageView imageView, int i) {
        RequestManager with = Glide.with(imageView.getContext());
        ((RequestBuilder) ((RequestBuilder) ((RequestBuilder) with.load(str + "?m=1&w=" + i).placeholder(C1010R.C1012drawable.base_ic_default)).error(C1010R.C1012drawable.base_ic_default)).fallback(C1010R.C1012drawable.base_ic_default)).into(imageView);
    }
}
